home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_20 / noteon.c < prev    next >
C/C++ Source or Header  |  1995-01-01  |  510b  |  37 lines

  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include "midifile.h"
  4. #include "console.h"
  5.  
  6. FILE *F;
  7. extern long Mf_currtime;
  8.  
  9. mygetc() { return(getc(F)); }
  10.  
  11. mynoteon(chan,note,velocity)
  12. int chan;
  13. unsigned char note;
  14. unsigned char velocity;
  15. {
  16.     printf("%ld: chan=%d, note=%d, velocity=%d\n",Mf_currtime, chan, note, velocity);
  17. }
  18.  
  19. main(argc,argv)
  20. char **argv;
  21. {
  22.     argc = ccommand(&argv);
  23.     
  24.     if ( argc > 1 )
  25.         F = fopen(argv[1],"r");
  26.     else
  27.         F = stdin;
  28.  
  29.     Mf_getc = mygetc;
  30.     Mf_noteon = mynoteon;
  31.  
  32.     midifile();
  33.  
  34.     exit(0);
  35. }
  36.  
  37.